package jpsearchcore;

import java.util.ArrayList;
import java.util.List;

public class RegionLocator {
	
	private List<Region> regions = new ArrayList<RegionLocator.Region>();

	public RegionLocator(){}
	
	public RegionLocator(List<IntegerMatrixType> imt){
		for(IntegerMatrixType i : imt){
			regions.add(new Region(i));
		}
	}
		
	public List<Region> getRegions() {
		return regions;
	}

	public static class Region{

		private List<Integer> Area = new ArrayList<Integer>();
		private int Dimension = 0;

		public Region(List<Integer> area, int dimension) {
			Area = area;
			Dimension = dimension;
		}

		public Region(IntegerMatrixType imt){
			Area = imt.getValue();
			Dimension = imt.getDim().intValue();
		}
		
		public List<Integer> getArea() {
			return Area;
		}

		public int getDimension() {
			return Dimension;
		}
		
		public void setDimension(int d){
			Dimension = d;
		}

		public String toString(){
			String output = "Region: [\n\tArea: [";
			for(Integer i : Area){
				output += i.toString() + " ";
			}
			output += "]\n\tDimension: " + Dimension + "\n]";
			return output;
		}

	}
}
